home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / edit / aaem95ma.zip / MACROS.HLP < prev    next >
INI File  |  1995-02-09  |  4KB  |  66 lines

  1. [THIS FILE IS MACROS.HLP]
  2.   After you have defined and keybound a few macros and buffers, an example of
  3. AAEMACS macrofile format can be got by going to a spare buffer and typing 'alt-X
  4. prmacros' and 'alt-X boundbuffers'. As in C: statements end in ';' and can run
  5. onto the next line, and several statements can go on the same line.
  6.   I recommend the suffix '.AMB' for AAEMACS macro-and-bufferloading files.
  7.   An ordinary command is the name of a routine (see HELP.BIG), followed perhaps
  8. by arguments in (round brackets) separated by commas. They can only be within
  9. macros, and are obeyed when the macro is called. They do not start with '#'.
  10.   If the first argument is an integer, it is used when calling the routine,
  11. like 'esc number' and 'alt_numbers' before a key code, and is called N in the
  12. information in files HELP and HELP.BIG .
  13.   Some routines want other arguments also: a string, or two strings, or a
  14. keysequence. If omitted, the routine will ask the user for this information
  15. when it is called.
  16.   A string is "" with zero or more characters between. ^ before a letter or any
  17. of [\]^_ means 'ctrl-'. ^M is end-of-line. \ followed by 3 octal digits means
  18. the character with that ASCII octal number, as in C. ^@ is ASCII-zero. ` before
  19. a character means that that character is magic (i.e. has a special meaning). To
  20. express ^ and " and \ and ` themselves, put \^ and \" and \\ and \`
  21.   Pressing alt# gets a menu of the currently defined macros.
  22.   For keyseq, see under 'functions' below.
  23.  
  24.   Commands starting with # are obeyed when the macro file is read:-
  25.  #beginmacro              Start the current macro which is called by 'ctrl-X E'.
  26.  #beginmacro(keyseq(--))  Start a macro & bind it to the keysequence specified.
  27.  #beginmacro("--")        Ditto, but also callable like a keyfunction using the
  28.  #beginmacro("--",keyseq(--))    name which here is the 1st arg of beginmacro.
  29.  #endmacro                End the macro which is being read.
  30.  #unbindkey(keyseq(--))   Unbind the key sequence specified.
  31.  #buffer("--")            Read that file into a buffer, like ctrl-X ctrl-F does.
  32.  #buffer("--",keyseq(--)) Ditto, and bind that buffer to the key seq specified.
  33.  
  34.   A macro line can be:- <routine call> or <expression> or <declaration>.
  35.   An expression is a name, or a string, or a signed or unsigned integer number,
  36. or a function call, or an operation.
  37.  
  38.   [DECLARATION LINES]:-
  39.   Names contain letters &/or numbers &/or '_', but not number first. These
  40. lines inside macros declare local variables, and outside macros declare global
  41. variables. 'altX readmacros' first removes all current global variables.
  42.   int -,-,-;     1 or more args, all names. Declares them as integer variables.
  43.   string -,-,-;  1 or more args, all names. Declares them as string variables.
  44.  
  45.   [FUNCTIONS]:-
  46.   currentbuffer  0 args. Returns a string = full name of current buffer.
  47.   keyseq(-,-,-)  1 or more args, all literal characters or names of keys (see
  48. file INFO.DAT). These should form a legal key sequence. Returns this
  49. keysequence as a 'keyseq' type value.
  50.  
  51.   [OPERATIONS]:-
  52.   <variable> = <expression> is assignment.
  53.   ( ) + - * / = != == < > <= >= are as in C.
  54.   Values are integer (except for '=' with string type arguments).
  55.   Allowed operator uses can be found by typing ctrl-_ and then o
  56.  
  57.   [LABELS]:-
  58.   Labels are a name followed by a colon, as in C. Global labels are not allowed.
  59.   Jumps to labels are by the subroutine goto(....), whose argument is a label.
  60.   goto(..) does nothing if the label has not been defined.
  61.  
  62.   [CONDITIONS]:-
  63.   The 1st argument of the subroutine if(-,-,-) is integer; the 2nd and
  64. (optional) 3rd can be anything. If that integer is not zero, the 2nd argument is
  65. obeyed; else the 3rd argument (if any) is obeyed.
  66.